#include "widget.h"
#include "ui_widget.h"
#include<QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    qDebug()<<"默认焦点设置";
    qDebug()<<ui->lineEdit->focusPolicy();
    qDebug()<<ui->lineEdit_2->focusPolicy();
    qDebug()<<ui->lineEdit_3->focusPolicy();
    qDebug()<<ui->lineEdit_4->focusPolicy();

    //设置焦点方式
    ui->lineEdit_2->setFocusPolicy(Qt::NoFocus);//禁止
    ui->lineEdit_3->setFocusPolicy(Qt::TabFocus);
    ui->lineEdit_4->setFocusPolicy(Qt::ClickFocus);

    ui->pushButton->setText("按钮");
    QFont font;
    font.setBold(true);
    font.setPointSize(10);
    ui->pushButton->setFont(font);



}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_clicked()
{
    qDebug()<<ui->lineEdit->text();
    qDebug()<<ui->lineEdit_2->text();
    qDebug()<<ui->lineEdit_3->text();
    qDebug()<<ui->lineEdit_4->text();
}

